package org.eclipse.football;

import static org.junit.Assert.*;

import org.junit.Test;

public class FindTeam {

	@Test
	public void test() {
		// Initialize a league
		League league = new League("does_not_exist.txt");
		
		// Initialize 3 teams with different names
		Team team1 = new Team("team1","user1");
		Team team2 = new Team("team2","user2");
		Team team3 = new Team("team3","user3");
		
		// Add 3 teams to league
		league.addTeam(team1);
		league.addTeam(team2);
		league.addTeam(team3);
		
		// Try to find team that does not exist
		Team team = league.findTeam("fake");
		
		// Make sure team is null
		assertTrue(!(team != null));
//		if(team != null){
//			// If not then fail
//			fail("League returned a team when searching for a team that didn't exist");
//		}
		
		// Try to find team2
		team = league.findTeam("team2");
		
		// Make sure a team was returned
		assertTrue(!(team == null));
//		if(team == null){
//			// If not then fail
//			fail("No team was returned when a valid team was searched for by name");
//		}
		
		// Make sure correct team was returned
		assertTrue(team.getName().equals("team2"));
//		if(!team.getName().equals("team2")){
//			// If not then fail
//			fail("Wrong team was returned when searching for a team by name");
//		}
	}

}
